package com.jifujun.junbatis.base.service;


import lombok.ToString;

/**
 * Create with IntelliJ IDEA
 * Project Name: junbatis
 * Package Name: club.emergency.junbatis.base.club.emergency.club.emergency.staff.model
 * Date: 2018/4/4 11:10
 * User: 快乐的小菌菌
 * Description:
 */
@ToString
public class Page extends ConditionConstructor {
    private Integer offset;
    private Integer pageNo;
    private Integer totalPage;
    private Integer totalCount;
    private Integer pageSize = 10;

    public Integer getOffset() {
        this.offset = (this.pageSize * this.pageNo) - this.pageSize;
        return offset;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo <= 0 ? 1 : pageNo;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
}
